package com.study.algorithm.io;

import java.util.ArrayList;
import java.util.Scanner;

public class MyScan {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ArrayList<String> ss = new ArrayList<>();
        System.out.println("输入Q退出：");
        while (scanner.hasNext()) {
            String next = scanner.next();
            if ("Q".equals(next.toUpperCase())) {
                break;
            }
            ss.add(next);
        }
        System.out.println(ss);
    }
}
